import Koa from 'koa';
import Router from 'koa-router';
import bodyParser from 'koa-bodyparser';
import myRouter from './routes/index.js';
const logger = require('koa-logger')
const app = new Koa();
const router = new Router();
const hostname = '0.0.0.0'
const port = 3000
app.use(bodyParser());
router.use('/api/v1', myRouter.routes(), myRouter.allowedMethods());
app.use(logger());
app.use(router.routes()).use(router.allowedMethods());

app.listen(port, hostname, () => {
    console.log(`Server running at http://${hostname}:${port}/`);
});